package zrand

import "math/rand"

func RandomMultiple(count, minNum, maxNum int) []int {
	list := make([]int, 0)
	if maxNum > minNum {
		if count > maxNum-minNum {
			count = maxNum - minNum
		}
		m := make(map[int]struct{})
		for len(m) < count {
			v := minNum + rand.Intn(maxNum-minNum)
			if _, ok := m[v]; !ok {
				m[v] = struct{}{}
				list = append(list, v)
			}
		}
	}
	return list
}
